<?php
$level_id = set_value('level_id',$applicants->applying_level_id);
$guidance_level_id = set_value('guidance_level_id',$applicants->guidance_recommend_level_id);
$previous_school = set_value('level_code',$applicants->previous_school);
$schedule_for_testing = set_value('schedule_for_testing',$applicants->schedule_for_testing);
$guidance_approved = set_value('guidance_approved',$applicants->guidance_approved);
$guidance_status = set_value('guidance_status',$applicants->guidance_status);
$guidance_school_records = set_value('guidance_school_records',$applicants->guidance_school_records);
$guidance_recommendation = set_value('guidance_recommendation',$applicants->guidance_recommendation);

$chooseAttrib = array('pending' => 'Pending', 'yes' => 'Yes', 'no' => 'No','N/A' => 'N/A');
$chooseRecom = array('esl' => 'ESL(English as Second Language)', 'star_1_m' => 'STAR 1on1 Monthly', 'star_1_t' => 'STAR 1on1 Trimesteral', 'star_1_a' => 'STAR 1on1 Anually', 'star_g_m' => 'STAR Group Monthly', 'star_g_t' => 'STAR Group Trimesteral', 'star_g_a' => 'STAR Group Anually', 'summer' => 'Summer');
$chooseStatus = array('regular student' => 'Regular Student', 'visiting student' => 'Visiting Student', 'non-credit' => 'Non-Credit', 'alternative education' => 'Alternative Education');
$chooseAppoved = array('0' => 'No', '1' => 'Yes');
//var_dump($optional_fees);
?>
<?echo $system_message;?>
<?echo form_open('applicant/update_status/'.$applicants->e_id,'class="custom" autocomplete="off"');?>

<div class="section-container auto" data-section>
  <section class="active">
    <p class="title" data-section-title><a href="#panel1">Update Applicant Status</a></p>
    <div class="content" data-section-content>
		<p>


	<div>
	
		<div class="row collapse">
			<div class="small-4 large-4 columns">
				<span class="prefix">Full Name</span>
			</div>
			<div class="small-8 large-8 columns">
				<input type="text" style="font-style:capitalize;" value="<?php echo ucwords(strtolower($applicants->firstname)); echo $applicants->middlename!=NULL?' '.ucwords(strtolower($applicants->middlename)):''; echo ' '.ucwords(strtolower($applicants->lastname)); echo $applicants->name_ext!=NULL?' '.ucwords(strtolower($applicants->name_ext)):''; ?>" disabled="disabled" >
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">Applying For Grade Level</span>
			</div>
			<div class="small-8 large-8 columns">
				<?php echo form_dropdown('level_id', $levels, $level_id, 'disabled="disabled"');?>
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">Date of Testing</span>
			</div>
			<div class="small-8 large-8 columns">
				<span style="font-size:10px; color:red; display:none;" id="schedule_for_testing_notice">Schedule of Testing cannot be blank. Required entry.</span>
				<input type="text" id="schedule_for_testing" name="schedule_for_testing" value="<?php echo $schedule_for_testing; ?>" class="disable" >
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">Last School Attended</span>
			</div>
			<div class="small-8 large-8 columns">
				<input type="text" name="p_a_previous_school" value="<?php echo $previous_school; ?>" >
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">School Records</span>
			</div>
			<div class="small-8 large-8 columns">
				<?=form_dropdown('guidance_school_records', $chooseAttrib, $guidance_school_records);?>
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">Status</span>
			</div>
			<div class="small-8 large-8 columns">
				<?=form_dropdown('guidance_status', $chooseStatus, $guidance_status);?>
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">Guidance Grade Level Recommendation</span>
			</div>
			<div class="small-8 large-8 columns">
				<?php echo form_dropdown('guidance_level_id', $levels, $guidance_level_id);?>
			</div>
			<div class="small-12 large-12 columns">
				<span>Guidance Recommendations:</span>
			</div>
			<div class="small-12 large-12 columns">
				<table class="data-table">
					<thead class="tabular-head">
						<th>Available Fees to add</th>
						<th>Fee Rates</th>
					</thead>
					<tbody class="tabular">
					<?php if(!empty($optional_fees)):?>
						<?php foreach($optional_fees as $key => $value):?>
							<tr>
								<td><input type="checkbox" name="fee[][<?=$value['sef_fee_rate'];?>]" value="<?=$value['sef_fee_name'];?>"> <?=$value['sef_fee_name'];?></td>
								<td><?=$value['sef_fee_rate'];?></td>
							</tr>
						<?php endforeach;?>
					<?php endif;?>
					<tbody>
				</table>
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix">Other Guidance Recommendation</span>
			</div>
			<div class="small-8 large-8 columns">
				<input type="text" name="guidance_recommendation" value="<?php echo $guidance_recommendation; ?>" >
			</div>
			<div class="small-4 large-4 columns">
				<span class="prefix" style="background-color:#47875A;">Guidance Approved</span>
			</div>
			<div class="small-8 large-8 columns">
				<?=form_dropdown('guidance_approved', $chooseAppoved, $guidance_approved);?>
			</div>
			<div class="small-4 large-4 columns">
				<input type="checkbox" name="p_a_moved" value="yes" <?php if($applicants->moved_to=='yes'){ echo'checked="checked"'; }?> /> Moved To Enrollment
			</div>
			<div class="small-8 large-8 columns">
				&nbsp;
			</div>
			<div class="clearfix"></div>
			<div>&nbsp;</div>
			<input type="hidden" name="e_profile_id" value="<?php echo $applicants->e_profile_id; ?>">
			<input type="submit" class="button small" id="update_applicant" name="update_applicant" value="Submit">
			
		</div>
	
	</div>
	
		</p>
    </div>
  </section>
 
  <section>
    <p class="title" data-section-title><a href="#panel2">Entrance Test</a></p>
    <div class="content" data-section-content>
      <p>
	  <?php echo $this->load->view('applicant/_entrance_test_result'); ?>
	  </p>
    </div>
  </section>

  <section>
    <p class="title" data-section-title><a href="#panel3">New Student Assessment & Application Form</a></p>
    <div class="content" data-section-content>
      <p>
	  <?php echo $this->load->view('applicant/_assessment_fee'); ?>
	  </p>
    </div>
  </section>
</div>	

<?php echo form_close(); ?>

<script>
	 $('#update_applicant').bind('click submit', function(event) {
				
		if($('#schedule_for_testing').val()!='' && $('#schedule_for_testing').val()!=' ')
		{
			$("#schedule_for_testing_notice").css({ display: "none" });
		}else{
			$("#schedule_for_testing_notice").css({ display: "block" });
		}
	  
	  if($('#schedule_for_testing').val()=='' || $('#schedule_for_testing').val()==' ')
	  {
		event.preventDefault();
	  }
    });
</script>